//
//  ColorConfig.swift
//  PPApp
//
//  Created by xiaopin on 2024/2/28.
//

import UIKit

//MARK: 颜色获取方法
func pp_color(_ name:ColorName) -> UIColor{
    return UIColor(named: name.rawValue)!
}

/// 获取ColorSet配置的颜色
/// - Parameter colorSetName: Assets.xcasets里配置的ColorSet名字
/// - Returns: <#description#>
func pp_color(_ colorSetName:String) -> UIColor{
    return UIColor(named: colorSetName)!
}


/// 获取颜色
/// - Parameters:
///   - light: 16进制：FFFFFF
///   - dark: 16进制：000000
/// - Returns: <#description#>
func pp_color(_ light:String, _ dark:String) -> UIColor{
    let lightColor = UIColor.hexColor(light)
    let darkColor = UIColor.hexColor(dark)
    return pp_color(XPApplication.shared.themeMode, lightColor, darkColor)
}

func pp_color(_ light:UIColor, _ dark:UIColor) -> UIColor{
    return pp_color(XPApplication.shared.themeMode, light, dark)
}

//MARK: 全局色调配置
/// 在Assets中Colors配置的名字，可以自动适应暗黑
enum ColorName:String {
    /// 主色：EEEEEE ，暗黑色：37383C
    case Seperator = "Seperator"
    /// 主色：303CCE ，暗黑色：3A83F6
    case C303CCE = "C303CCE"
    case C000000_000000 = "C000000_000000"
    case C4E8FFF_2D538E = "C4E8FFF_2D538E"
    /// 主色：159F48 ，暗黑色：3A83F6
    case C159F48 = "C159F48"
    case C159F48_159F48 = "C159F48_159F48"
    /// 主色：222222 ，暗黑色：A2A5A3
    case C222222 = "C222222"
    case C222222_3A83F6 = "C222222_3A83F6"
    case C222222_97979B = "C222222_97979B"
    case C333333_272730 = "C333333_272730"
    case C33333308_272730 = "C33333308_272730"
    case C333333_A2A2A5 = "C333333_A2A2A5"
    /// 主色：555555 ，暗黑色：838A84
    case C555555 = "C555555"
    case C555555_888888 = "C555555_888888"
    case C555555_97979B = "C555555_97979B"
    case C555555_A2A2A5 = "C555555_A2A2A5"
    /// 主色：707070 ，暗黑色：a2a2a5
    case C707070 = "C707070"
    /// 主色：777777 ，暗黑色：58585F
    case C777777 = "C777777"
    /// 主色：999999 ，暗黑色：505450
    case C999999 = "C999999"
    case C999999_888888 = "C999999_888888"
    case C999999_A2A2A5 = "C999999_A2A2A5"
    case C999999_555555 = "C999999_555555"
    /// 主色：CCCCCC ，暗黑色：888888
    case CCCCCCC = "CCCCCCC"
    case CCCCCCC_37383C = "CCCCCCC_37383C"
    /// 主色：E8E8E8 ，暗黑色：888888
    case CE8E8E8 = "CE8E8E8"
    /// 主色：EBEBEB ，暗黑色：26262B
    case CEBEBEB = "CEBEBEB"
    /// 主色：EDF2F9 ，暗黑色：37383C
    case CEDF2F9 = "CEDF2F9"
    case CEEFCF5_EEFCF5 = "CEEFCF5_EEFCF5"
    case CEEFCF5_203128 = "CEEFCF5_203128"
    /// 主色：EEEEEE ，暗黑色：373C39
    case CEEEEEE = "CEEEEEE"
    case CEEEEEE_EEEEEE = "CEEEEEE_EEEEEE"
    case CEEEEEE_272730 = "CEEEEEE_272730"
    case CEEAF1E = "CEEAF1E"
    /// 主色：F5F5F5 ，暗黑色：26262B"
    case CF5F5F5 = "CF5F5F5"
    case CF5F5F5_37383C = "CF5F5F5_37383C"
    case CF5F5F5_373C39 = "CF5F5F5_373C39"
    case C373C39_373C39 = "C373C39_373C39"
    /// 主色：CF6F6F6 ，暗黑色：26262B"
    case CF6F6F6 = "CF6F6F6"
    /// 主色：F8F8F8 ，暗黑色：26262B
    case CF8F8F8 = "CF8F8F8"
    case CF8F8F8_141816 = "CF8F8F8_141816"
    case CF8F8F8_272730 = "CF8F8F8_272730"
    case CF8F8F8_37383C = "CF8F8F8_37383C"

    /// 主色：F8321B ，暗黑色：DC463C
    case CF8321B = "CF8321B"
    /// 主色：FFE9E9 ，暗黑色：34252B
    case CFFE9E9 = "CFFE9E9"
    /// 主色：FF8B43 ，暗黑色：FF8B43
    case CFF8B43 = "CFF8B43"
    case CFF8B43_272730 = "CFF8B43_272730"
    /// 主色：FFFFFF ，暗黑色：212623
    case CFFFFFF = "CFFFFFF"
    /// 主色：F2F2F2 ，暗黑色：272730
    case CF2F2F2 = "CF2F2F2"
    case CFFFFFF_1F2120 = "CFFFFFF_1F2120"
    case CFFFFFF_FFFFFF = "CFFFFFF_FFFFFF"
    case CFFFFFF_272730 = "CFFFFFF_272730"
    case CFFFFFF_26262B = "CFFFFFF_26262B"
    case CFFFFFF_A2A2A5 = "CFFFFFF_A2A2A5"
    case CFFFFFF_555555 = "CFFFFFF_555555"
    case CFFFFFF_90B2E0 = "CFFFFFF_90B2E0"
    case CFFFFFF_373C39 = "CFFFFFF_373C39"
    /// 主色：FFFCF3 ，暗黑色：333740
    case CFFFCF3 = "CFFFCF3"
    case CFEF3F3_203128 = "CFEF3F3_203128"
    /// 主色：E8F0FF ，暗黑色：506388
    case CE8F0FF = "CE8F0FF"
    /// 主色：F3F3F3 ，暗黑色：26262B
    case CF3F3F3 = "CF3F3F3"
    /// 主色：F84444 ，暗黑色：C73737
    case CF84444 = "CF84444"
    /// 主色：F4F4F4,  暗黑色：151619
    case CF4F4F4 = "CF4F4F4"
    /// 主色：F4F4F4,  暗黑色：37383C
    case CF4F4F4_37383C = "CF4F4F4_37383C"
    case CF4F9F5_262B27 = "CF4F9F5_262B27"
    case CF4F9F5_252B28 = "CF4F9F5_252B28"
    case CF5F6F8_141615 = "CF5F6F8_141615"
    case CF9F9F9_232725 = "CF9F9F9_232725"
    case CF5F6F8_26262B = "CF5F6F8_26262B"
    case CF5F6F8_555555 = "CF5F6F8_555555"
    case CFFF3E2_FFF3E2 = "CFFF3E2_FFF3E2"
    /// 主色：C1A0000, 暗黑色：
    case C1A0000 = "C1A0000"
    /// 主色：FF7B84, 暗黑色：FF7B84
    case CFF7B84 = "CFF7B84"
    /// 主色：FFF6F0, 暗黑色：FFF6F0
    case CFFF6F0 = "CFFF6F0"
    /// 主色：FFF6E6, 暗黑色：212226
    case CFFF6E6 = "CFFF6E6"
    /// 主色：FF9100, 暗黑色：FF9100
    case CFF9100 = "CFF9100"
    /// 主色：EBF4FF ，暗黑色：232C3B
    case CEBF4FF = "CEBF4FF"
    /// 主色：5EA4FA ，暗黑色：305CA3
    case C5EA4FA = "C5EA4FA"
    /// 主色：93BAFF ，暗黑色：283F65
    case C93BAFF = "C93BAFF"
    /// 主色：FEE224 ，暗黑色：E8CD19
    case CFEE224 = "CFEE224"
    /// 主色：AD7601 ，暗黑色：7B5503
    case CAD7601 = "CAD7601"
    /// 主色：F09B16 ，暗黑色：F09B16
    case CF09B16 = "CF09B16"
    /// 主色：FFE6A5 ，暗黑色：FFE6A5.alpha:0.15
    case CFFE6A5 = "CFFE6A5"
    /// 主色：F35B60 ，暗黑色：F35B60
    case CF35B60 = "CF35B60"
    /// 主色：FBDFDC ，暗黑色：F35B60.alpha:0.15
    case CFBDFDC = "CFBDFDC"
    /// 主色：BDD5FF，暗黑色：BDD5FF
    case CBDD5FF = "CBDD5FF"
    /// 主色：FF2237，暗黑色：DC463C
    case CFF2237 = "CFF2237"
    /// 主色：FE9324，暗黑色：FF8B43
    case CFE9324 = "CFE9324"
    /// 主色：5ADA7B，暗黑色：55CF74
    case C5ADA7B = "C5ADA7B"
    /// 主色：D4E4FF，暗黑色：374E74
    case CD4E4FF = "CD4E4FF"
    /// 主色：003490, 暗黑色：0E1C34
    case C003490 = "C003490"
    /// 主色：F1F1F1, 暗黑色：272730
    case CF1F1F1 = "CF1F1F1"
    /// 主色：CF8F8FA, 暗黑色：272730
    case CF8F8FA = "CF8F8FA"
    /// 主色：C5B5B64, 暗黑色：97979B
    case C5B5B64 = "C5B5B64"
    /// 主色：#00358F, 暗黑色：#2B5DB1
    case C00358F = "C00358F"
    /// 主色：#F4F5F9, 暗黑色：#272730
    case CF4F5F9 = "CF4F5F9"
    /// 主色：#A15800, 暗黑色：#F2AE5C
    case CA15800 = "CA15800"
    /// 主色：#EFF5FF, 暗黑色：#37383C
    case CA4B5A7 = "CA4B5A7"
    case CEFF5FF = "CEFF5FF"
    /// 主色：#F7F7F7, 暗黑色：#141518
    case CF7F7F7 = "CF7F7F7"
    /// 主色：#F7F7F7, 暗黑色：#37383C
    case CF7F7F7_37383C = "CF7F7F7_37383C"
    /// 主色：#F7F7F7, 暗黑色：#262B28
    case CF7F7F7_262B28 = "CF7F7F7_262B28"
    /// 主色：#25B16B, 暗黑色：#25B16B
    case C25B16B = "C25B16B"
    ///主色 #ABBC9C
    case CABBC9C = "CABBC9C"
    ///朱色 #DDDDDD
    case CDDDDDD = "CDDDDDD"
    
}

///临时的，没有暗黑模式，到时候集体改
let pp_color_FF283C = UIColor.hexColor("FF283C")
let pp_color_E3EDFF = UIColor.hexColor("E3EDFF")
let pp_color_FF6326 = UIColor.hexColor("FF6326")
let pp_color_25B16B = UIColor.hexColor("25B16B")
let pp_color_19BC9B = UIColor.hexColor("19BC9B")

//主色调
let Color_Main1 = #colorLiteral(red: 0.1568627451, green: 0.4666666667, blue: 1, alpha: 1)    //UIColor(hex:"159F48",alpha:1)  //蓝色
let Color_Main2 = #colorLiteral(red: 0.1176470588, green: 0.4862745098, blue: 0.7019607843, alpha: 1)    //UIColor(hex:"1E7CB3",alpha:1)  //橘色

//灰色
let Color_Gray2 = #colorLiteral(red: 0.9176470588, green: 0.9176470588, blue: 0.9176470588, alpha: 1) //UIColor(hex: "EAEAEA", alpha: 1)
let Color_Gray3 = #colorLiteral(red: 0.8666666667, green: 0.8666666667, blue: 0.8666666667, alpha: 1) //UIColor(hex: "DDDDDD", alpha: 1)
let Color_Gray6 = #colorLiteral(red: 0.7058823529, green: 0.7058823529, blue: 0.7058823529, alpha: 1) //UIColor(hex: "B4B4B4", alpha: 1)
let Color_Gray8 = #colorLiteral(red: 0.5490196078, green: 0.5490196078, blue: 0.5490196078, alpha: 1) //UIColor(hex: "8C8C8C", alpha: 1)

//黑色
let Color_Black5 = #colorLiteral(red: 0.3333333333, green: 0.3333333333, blue: 0.3333333333, alpha: 1) //#555555
let Color_Black7 = #colorLiteral(red: 0.4666666667, green: 0.4666666667, blue: 0.4666666667, alpha: 1) //#777777
